package com.yumeng.framework.persistence.mybatis.base.page.param;

import io.swagger.v3.oas.annotations.media.Schema;

/**
 * @author wxd
 * @date 2021/11/29 17:31
 */
public class OrderParam {

    public OrderParam(){}
    public OrderParam(String name, Boolean asc){
        this.name = name;
        this.asc = asc;
    }

    /**
     * 前端传的是属性名，需映射转化
     * 后端指定默认的排序时，传字段名，直接使用
     */
    @Schema(description = "排序字段")
    //@NotBlank(message = "排序字段不能为空")
    private String name;
    @Schema(description = "是否正序，默认true")
    private Boolean asc;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getAsc() {
        return asc != null ? asc : true;
    }

    public void setAsc(Boolean asc) {
        this.asc = asc;
    }
}
